]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Handle child not being present in the window slots array
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 21 Nov 2020 23:10:56 +0000 (00:10 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 24 Nov 2020 20:20:45 +0000 (20:20 +0000)
Adding children to the WorkspaceLayout without calling addPreview() is
not supported, so let's log an error in case that happened.

We also have to allocate that child an empty ClutterActorBox, otherwise
Clutter will complain loudly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1481>

js/ui/workspace.js

index ee6e198b1ea1f41a0f8a52c7316773b7f504141c..ab49e64123c6744682c00f09ddd0a400edfb0235 100644 (file)
@@ -595,8 +595,11 @@ var WorkspaceLayout = GObject.registerClass({
 
             // The fifth element in the slot array is the WindowPreview
             const index = this._windowSlots.findIndex(s => s[4] === child);
-            if (index === -1)
+            if (index === -1) {
+                log('Couldn\'t find child %s in window slots'.format(child));
+                child.allocate(childBox);
                 continue;
+            }
 
             const [x, y, width, height] = this._windowSlots[index];
             const windowInfo = this._windows.get(child);